﻿<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
	<title>Sewise Player</title>
	<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="../player/sewise.player.min.js"></script>
	<style type="text/css">
		.top {
			float: left;
			width: 100%;
			height: 30px;
			margin: 10px;
		}
		#player {
			float: left;
			width: 640px;
			height: 360px;
			margin: 5px;
			padding: 10px;
			border:1px solid #999;
		}
		.top p{
			float: left;
			color: #F00;
		}
		#select {
			float: left;
			width: 200px;
			height: 30px;
			margin:10px;
		}
	</style>
</head>
<body>
	<div>
		<div class="top">
			<p>换台</p>
			<select id="select"></select>
		</div>
		<div id="player">
			<script type="text/javascript">
				var programArray = [
					{"name": "宜和购物", "url": "http://116.77.32.202:5080/data/userdata/vod/resource/201408/21141727.flv.m3u8"},
					{"name": "深圳电视剧", "url": "http://116.77.32.199:5080/hls/xikf3h9q.m3u8"},
					{"name": "安眼测试", "url": "http://115.231.92.47:9110/real.m3u8?channel_idx=1&device_id=A006yd14sc00troxOUPR&duration=0&from_ip=218.80.1.89&rate=1000&user_name=1000&ver=1.0.0.48&token=fQ/dOqERYvZEltcMYAQROmBUTiDfrYkJqUk2lIDt1HS/tVdYIqQtcvuV8DBNFGJQKhupWZ3JaDmNkBzdJKazWQ==&v_width=1280&v_height=720"},
					{"name": "优酷电影", "url": "http://pl.youku.com/playlist/m3u8?ts=1413447142&keyframe=1&ykss=a6ec3d54e76f345821be8ae7&vid=XMzM3MzIwNTI0&type=flv&sid=6413447142906212bad07&token=6701&oip=1944544396&ep=W3QaazLJ6MJjY0RQ87mH5t3ffCVpllWMsoRGJNyNP6EPUnfLuNmZc6IQ9vkzJWPC&did=3f2189e6a744e68de6761a20ceaf379aa8acfad4&ctype=21&ev=1"},
					{"name": "乐视电影", "url": "http://g3.letv.cn/vod/v2/NzQvMzEvNTIvbGV0di11dHMvMTQvdmVyXzAwXzE2LTI2ODY4MjI5LWF2Yy0yMjk1OTQtYWFjLTMyMDAxLTY5Njg3NTMtMjM2MTYwMjg3LTIzZWM2YTJjNGVjZmNjNTYzZWJmYzFmMmQ1MjcwZTRmLTE0MDc3ODUzMzEwMzYubXA0?b=271&mmsid=2181963&tm=1415858824&key=ee1f384d73f341e23289643a14cd3610&platid=3&splatid=304&playid=0&tss=ios&vtype=21&cvid=964198564846&retry=1"}
				];
				
				SewisePlayer.setup({
					server: "vod",
					type: "m3u8",
					buffer: 5,
					autostart: "true",
			    	skin: "vodWhite",
					lang: "zh_CN",
					draggable: "true",
					claritybutton: "disable",
					videourl: "",
					title: "切换播放"
				}, "player");
				SewisePlayer.playerReady(function(name){
					SewisePlayer.toPlay(programArray[0]["url"], programArray[0]["name"], 0, true);
				});
				
				$(document).ready(function(){
					var len = programArray.length;
					for(var i = 0; i < len; i ++){
						$("#select").append('<option value ="' + programArray[i]["url"]  + '">' + programArray[i]["name"] + '</option>');
					}
					$("#select").change(function(e){
						var url = $("#select").find("option:selected").val();
						var title = $("#select").find("option:selected").text();
						SewisePlayer.toPlay(url, title, 0, true);
					});
				});
				
			</script>
		</div>
	</div>
</body>
</html>